﻿/*****************************************************************//**
 * @file    VAOneXMLAdaptorPhysicalProperties.h
 * @brief   VAOne读写物理属性适配器
 *
 * @author  lilongyuan (lilongyuan@diso.cn)
 * @date    2025-02-25
 *********************************************************************/
#ifndef VAONEXMLADAPTORPHYSICALPROPERTIES_H
#define VAONEXMLADAPTORPHYSICALPROPERTIES_H

#include "FITKAbstractVAOneXMLAdaptor.h"

namespace Acoustics
{
    class FITKAcousticsAbsPhysicsProp;
    class FITKPhyscisPropertyRibbed;
    class FITKPhyscisPropertyRibInfo;
    class FITKPhyscisPropertyGeneralLaminate;
}

namespace IO
{
    /**
     * @brief   VAOne读写物理属性适配器
     * @author  lilongyuan (lilongyuan@diso.cn)
     * @date    2025-02-25
     */
    class FITKVAOneXMLIOAPI VAOneXMLAdaptorPhysicalProperties : public FITKAbstractVAOneXMLAdaptor
    {
        FITKCLASS(IO, VAOneXMLAdaptorPhysicalProperties);
    public:
        /**
         * @brief   构造函数
         * @author  lilongyuan (lilongyuan@diso.cn)
         * @date    2025-02-25
         */
        explicit VAOneXMLAdaptorPhysicalProperties() = default;
        /**
         * @brief   析构函数
         * @author  lilongyuan (lilongyuan@diso.cn)
         * @date    2025-02-25
         */
        ~VAOneXMLAdaptorPhysicalProperties() = default;
        /**
         * @brief   适配器读数据
         * @return  是否执行成功
         * @author  lilongyuan (lilongyuan@diso.cn)
         * @date    2025-02-25
         */
        bool adaptR() override;
        /**
         * @brief   适配器写数据
         * @return  是否执行成功
         * @author  lilongyuan (lilongyuan@diso.cn)
         * @date    2025-02-25
         */
        bool adaptW() override;
    private:
        /**
         * @brief     读取梁物理属性数据
         * @param[i]  node BeamPhysicalProperty节点
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-25
         */
        bool readBeamPhysicalProperty(rapidxml::xml_node<char>* node);
        /**
         * @brief     读取板物理属性数据
         * @param[i]  node ShellPhysicalProperties节点
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-25
         */
        bool readShellPhysicalProperties(rapidxml::xml_node<char>* node);
        /**
         * @brief     读取均质板物理属性数据
         * @param[i]  node UniformPhysicalProperty节点
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-25
         */
        bool readUniformPhysicalProperty(rapidxml::xml_node<char>* node);
        /**
         * @brief     读取加筋板物理属性数据
         * @param[i]  node RibbedPhysicalProperty节点
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-25
         */
        bool readRibbedPhysicalProperty(rapidxml::xml_node<char>* node);
        /**
         * @brief     读取筋信息数据
         * @param[i]  node RibbedPhysicalProperty节点，data 加筋板物理属性数据对象
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-25
         */
        bool readRibSet(rapidxml::xml_node<char>* node, Acoustics::FITKPhyscisPropertyRibbed* data);
        /**
         * @brief     读取筋属性数据
         * @param[i]  node RibSet节点，data 筋信息数据对象
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-25
         */
        bool readRibSetAttribute(rapidxml::xml_node<char>* node, Acoustics::FITKPhyscisPropertyRibInfo* data);
        /**
         * @brief     读取自由阻尼层合板物理属性数据
         * @param[i]  node GeneralLaminatePhysicalProperty节点
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-25
         */
        bool readGeneralLaminatePhysicalProperty(rapidxml::xml_node<char>* node);
        /**
         * @brief     读取自由阻尼板层信息数据
         * @param[i]  node IsotropicLayer节点，manager 自由阻尼板管理器
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-25
         */
        bool readIsotropicLayer(rapidxml::xml_node<char>* node, Acoustics::FITKPhyscisPropertyGeneralLaminate* manager);
    private:
        /**
         * @brief     写出梁物理属性数据
         * @param[i]  node PhysicalProperties节点
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-25
         */
        bool writeBeamPhysicalProperty(rapidxml::xml_node<char>* node);
        /**
         * @brief     写出板物理属性数据
         * @param[i]  node PhysicalProperties节点
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-25
         */
        bool writeShellPhysicalProperties(rapidxml::xml_node<char>* node);
        /**
         * @brief     写出均质板物理属性数据
         * @param[i]  node ShellPhysicalProperties节点
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-25
         */
        bool writeUniformPhysicalProperty(rapidxml::xml_node<char>* node);
        /**
         * @brief     写出加筋板物理属性数据
         * @param[i]  node ShellPhysicalProperties节点
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-25
         */
        bool writeRibbedPhysicalProperty(rapidxml::xml_node<char>* node);
        /**
         * @brief     写出筋信息数据
         * @param[i]  nodeRibSet RibSet节点，dataRibSet 筋信息数据，axisNumber 加筋方向
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-26
         */
        bool writeRibSet(rapidxml::xml_node<char>* nodeRibSet, Acoustics::FITKPhyscisPropertyRibInfo* dataRibSet, int axisNumber);
        /**
         * @brief     写出自由阻尼层合板物理属性数据
         * @param[i]  node ShellPhysicalProperties节点
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-25
         */
        bool writeGeneralLaminatePhysicalProperty(rapidxml::xml_node<char>* node);
    private:
        /**
         * @brief     读取基础属性数据
         * @param[i]  node 节点，data 物理属性派生类数据对象
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-25
         */
        bool readBasicAttribute(rapidxml::xml_node<char>* node, Acoustics::FITKAcousticsAbsPhysicsProp* data);
        /**
         * @brief     写出基础属性数据
         * @param[i]  node 节点，data 物理属性派生类数据对象
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-25
         */
        bool writeBasicAttribute(rapidxml::xml_node<char>* node, Acoustics::FITKAcousticsAbsPhysicsProp* data);
    };

    Register2FITKIOAdaptorFactory(VAOneXML, PhysicalProperties, VAOneXMLAdaptorPhysicalProperties)
}

#endif // VAONEXMLADAPTORPHYSICALPROPERTIES_H
